#pragma once

#include <vector>
#include "llvm/Module.h"
#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "llvm/Instruction.h"
#include "llvm/Type.h"
#include "llvm/DerivedTypes.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/Instructions.h"

#include "Instrumenter.h"
#include "Utils.h"
#include "BranchProfiler.h"

typedef Instrumenter<BranchInst, BranchProfiler, bool> BranchBase;

struct BranchInstrumenter : public BranchBase
{
	BranchInstrumenter(Module *M, ExecutionEngine *EE) : BranchBase(M, EE) { }
	const Type* getArgType() 									{ return Type::getInt1Ty(C); }
	Value* InstrumentThis(BranchInst *Inst) 	{ return Inst->isConditional() ? Inst->getCondition() : 0; }
};

